package com.bnz.controller;

import com.bnz.pojo.Dept;
import com.bnz.pojo.R;
import com.bnz.service.DeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/dept")
public class DeptController {
    @Autowired
    private DeptService deptService;
    // 查询所有部门
    @RequestMapping("/list")
    public R findAll(){
        // 查询所有部门
        List<Dept> depts = deptService.findAll();
        return R.ok().put("list",depts);
    }

}
